import QtQuick 2.0
import QtQuick.Particles 2.0

Rectangle {
    id: root;
    width: 400;
    height: 400;

    property ParticleSystem particle: particleSystem;
    property alias text: label.text;

    color: "black";
    border.width: 2;
    border.color: "white";

    ParticleSystem {
        id: particleSystem;
    }

    Emitter {
        id: emitter;
        anchors.left: parent.left;
        anchors.verticalCenter: parent.verticalCenter;
        emitRate: 20;
        width: 1; height: 1;
        system: particleSystem;
        lifeSpan: 4000;
        lifeSpanVariation: 400;
        size: 16;
        endSize: 32;

        velocity: PointDirection {
            x: 100;
            xVariation: 0;
            y: 0;
            yVariation: 100/4;
        }
    }

    ImageParticle {
        source: "Images/png/star.png";
        system: particleSystem;
        color: "#FFD700";
        colorVariation: 0.6;
        rotation: 15;
        rotationVariation: 5;
        rotationVelocity: 45;
        rotationVelocityVariation: 15;
        entryEffect: ImageParticle.Scale;
    }

    Text {
        id: label;
        anchors.horizontalCenter: parent.horizontalCenter;
        anchors.bottom: parent.bottom;
        color: "white";
        font.pointSize: 14;
    }
}
